import { defineComponent, reactive, ref } from "vue";
import LPopup from "@/components/public/lPopup/lPopup";
import styles from "./Add.module.less";
export default defineComponent({
  setup(props, { expose }) {
    const lPopupRef = ref(null as any);
    const open = () => {
      lPopupRef.value.open();
    }
    const form = reactive({
      insurer_name: '',
      insurer_idno: '',
    })
    const closed = () => {
      form.insurer_idno = '';
      form.insurer_name = '';
    }
    expose({
      open,
    })
    return () => (
      <>
        <LPopup title="添加被保人" ref={lPopupRef} onClosed={() => closed()}>
          <div class={styles.add}>
            <div class={styles.row}>
              <div class={styles.label}>被保人姓名</div>
              <a-input class={styles.value} v-model={form.insurer_name} placeholder="请输入被保人姓名..."></a-input>
            </div>
            <div class={styles.row}>
              <div class={styles.label}>被保人身份证号</div>
              <a-input class={styles.value} v-model={form.insurer_idno} placeholder="请输入被保人身份证号..."></a-input>
            </div>
            <div class={styles.footer}>
              <a-button type="primary">确认</a-button>
              <a-button onClick={() => { lPopupRef.value.close() }}>取消</a-button>
            </div>
          </div>
        </LPopup>
      </>
    )
  }
})